﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace AppFlat.Domain.Models
{
    /// <summary>
    /// App基础信息
    /// </summary>
    [Serializable]
    public class AppInfo
    {

        public int Id { get; set; }
        [StringLength(20)]
        [Required]
        public string Name { get; set; }

        /// <summary>
        /// 类别编号
        /// </summary>
        public int CategoryId { get; set; }

        /// <summary>
        /// 最新版本
        /// </summary>
        [StringLength(20)]
        public string LastVersion { get; set; }

        /// <summary>
        /// 开发者
        /// </summary>
        public int DevUserId { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [StringLength(50)]
        public string Remark { get; set; }

        /// <summary>
        /// 适用平台
        /// </summary>
        [StringLength(20)]
        public string Rom { get; set; }

        /// <summary>
        /// 审核状态
        /// </summary>
        public int State { get; set; }

        [StringLength(200)]
        public string AppPath { get; set; }


        [ForeignKey(nameof(DevUserId))]
        public virtual DevUser DevUser { get; set; }

        //[JsonIgnore]
        [ForeignKey(nameof(CategoryId))]
        public virtual Category Category { get; set; }
    }
}
